import React, { useState} from "react";
import HomeClass from "./Erouter.jsx";
import ReactDOM from "react-dom";
import indexStyle from "./index.scss";
class ShadowsDom extends HTMLElement{
    constructor(){
        super();
        let newDom = this.attachShadow({mode:"open"});
        let newP = document.createElement("span");
        newP.textContent = "wdnmd";
        // shadow dom 监听事件
        newP.addEventListener("click",(e)=>{
            console.log(e);
        });
        let url = "http://localhost:3000/#/home",name="WYQ";
        ReactDOM.render(
            <div id="REACT_APP"><HomeClass /></div>
            ,newDom)
        // newDom.appendChild(newP);
    }
}
class MakeFirstDom{
    init(){
        customElements.define("i-p",ShadowsDom);
        let newDom = document.createElement("i-p");
        // 设置自定义属性
        newDom.setAttribute("is","i-p");
        newDom.className = `${indexStyle.a}`;
        return newDom;
    }
    

}
export default MakeFirstDom;